package com.pafa.wiki.controller;

import com.pafa.wiki.domain.Ebook;
import com.pafa.wiki.req.EbookReq;
import com.pafa.wiki.resp.CommonResp;
import com.pafa.wiki.service.EbookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/ebook")
public class EbookController {
    @Autowired
    public EbookService ebookService;

    @PostMapping("/list")
    public CommonResp list(@RequestBody EbookReq req){
        List<Ebook> list = ebookService.list(req);
        CommonResp resp = new CommonResp<>();
        resp.setContent(list);
        return resp;
    }

}
